package com.ymttest.database.sqlwapper;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.mapping.YmtTradeCheckMapper;
import com.ymttest.database.model.YmtTradeCheck;
import com.ymttest.utils.EnvSetup;

/************************************************************************************
 * @File name :DefaultWapper.java
 * @Author : zhouyi
 * @Date : 2015年6月1日
 * @Copyright : 洋码头
 ************************************************************************************/
public class YmtTradeCheckWapper {
	static SqlManager manage;

	public YmtTradeCheckWapper() {
		manage = new SqlManager("ymtfp");
	}

	/**
	 * 使用 sellerid 查询信息
	 * 
	 * @param i
	 * @throws InterruptedException
	 */
	public List<YmtTradeCheck> selectBySellerId(int sellerId,Date beginTime,Date endTime )
			throws InterruptedException {
		@SuppressWarnings("unchecked")
		Map m = new HashMap();	
		m.put("SellerId", sellerId);
		m.put("BeginTime", beginTime);
		m.put("EndTime", endTime);

		List<YmtTradeCheck> tradeCheckList = manage.getSelectResults(
				"com.ymttest.database.mapping.YmtTradeCheckMapper.mTradeCheckSelectbySellerId",
				m);
		manage.commit();
		return tradeCheckList;

	}

	
	/**
	 * 关闭数据库连接
	 */
	public void close() {
		manage.close();
	}

	@Override
	protected void finalize() throws Throwable {
		this.close();
		manage = null;
		super.finalize();
	}

	public static void main(String args[]) {

	}
}
